package com.futvan.z.framework.tags;

import java.util.List;

import javax.servlet.jsp.JspException;

import com.futvan.z.framework.core.SuperTag;
import com.futvan.z.framework.core.z;
import com.futvan.z.system.cms_column.cms_column;
import com.futvan.z.system.cms_info.cms_info;
import com.futvan.z.system.zcode.z_code;
import com.futvan.z.system.zcode.z_code_detail;

public class newsBox2 extends SuperTag {
	private String columnId;
	
	@Override
	public int doEndTag() throws JspException {
		StringBuffer out_html = new StringBuffer();
		try {
			if(z.isNotNull(columnId)) {
				cms_column col = z.cmsColumnForNumber.get(columnId);
				List<cms_info> cmslist = z.cmsList.get(col.getZid());
				out_html.append("<div class=\"row\">").append("\r\n");
				out_html.append("	<div class=\"col-md-12 newsBox_bc1\">").append("\r\n");
				out_html.append("		<div class=\"row\">").append("\r\n");
				out_html.append("			<div class=\"col-md-8 text-left newsBoxTitleImg \">"+col.getColumn_name()+"</div>").append("\r\n");
				out_html.append("			<div class=\"col-md-4 text-right\">更多 <i class=\"fa fa-angle-right\"></i></div>").append("\r\n");
				out_html.append("		</div>").append("\r\n");
				out_html.append("	</div>").append("\r\n");
				out_html.append("	<div class=\"col-md-6 padding-left-0 padding-top-10\">").append("\r\n");
				out_html.append("		<img src=\"img/web/c1.png\" width=\"100%\">").append("\r\n");
				out_html.append("	</div>").append("\r\n");
				out_html.append("	<div class=\"col-md-6 padding-left-0 padding-top-10\">").append("\r\n");
				out_html.append("		<div class=\"row\">").append("\r\n");
				int i=0;
				for (cms_info c : cmslist) {
					if(i<5) {
						out_html.append("			<div class=\"col-md-12 newsBox_title1\"><a class=\"clearA\" href=\"\">"+c.getTitle1()+"</a></div>").append("\r\n");
						i = i+1;
					}
				}
				out_html.append("		</div>").append("\r\n");
				out_html.append("	</div>").append("\r\n");
				out_html.append("</div>").append("\r\n");
			}
			outHTML(out_html.toString());
		} catch (Exception e) {
			z.Error("newBos2 error", e);
		}
		return super.doEndTag();
	}

	public String getColumnId() {
		return columnId;
	}

	public void setColumnId(String columnId) {
		this.columnId = columnId;
	}
	

}
